<template>
    <el-button @click="onCancel">取消</el-button>

    <div style="font-weight: bold; font-size: 25px; text-align: center;">仓库档案</div>

    <table border="1" style="border-collapse: collapse; width: 100%; height: 50px;">
        <tr>
            <td :colspan="4" style="width: 100%; height: 70px; font-size: 20px;background-color: lightcyan;">基本信息</td>
        </tr>
        <tr style="height: 70px; text-align: center; ">
            <td style="font-weight: bold;font-size: 17px;">仓库编号</td>
            <td>{{ form.updDto.wNumber }}</td>
            <td style="font-weight: bold;font-size: 17px;">仓库名称</td>
            <td>{{ form.updDto.wName }}</td>
        </tr>
        <tr style="height: 70px; text-align: center; ">
            <td style="font-weight: bold;font-size: 17px;">所属类别</td>
            <td>{{form.wTypes}}</td>
            <td style="font-weight: bold;font-size: 17px;">仓库地址</td>
            <td>{{ form.updDto.wAddress }}</td>
        </tr>
        <tr style="height: 70px; text-align: center; ">
            <td style="font-weight: bold;font-size: 17px;">备注</td>
            <td colspan="3">{{ form.updDto.warehouseRemark }}</td>
        </tr>
    </table>

</template>
<script setup lang="ts">
import {
    Check,
    Delete,
    Edit,
    Message,
    Search,
    Star,
} from '@element-plus/icons-vue'
import { onMounted, ref, reactive } from "vue";
import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
import { useRoute, useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import axios from "axios";
const route = useRoute();
const router = useRouter();
var dates = new Date();
import http from '../../../http.js'
const form = reactive({
    wTypes: '',
    "updDto": {
        "warehouseId": route.query.warehouseId,
        "wNumber": "string",
        "wName": "string",
        "wType": 0,
        "wAddress": "string",
        "warehouseRemark": "string",
        "addName": "string",
        "addTime": "2024-12-16T12:44:22.726Z",
        "updName": "string",
        "updTime": "2024-12-16T12:44:22.726Z",
        "delName": "string",
        IsDel: false,
        "delTime": "2024-12-16T12:44:22.726Z",
        "office_Id": "string",
        "user_Id": 0
    }
})




const tableData = ref([])

onMounted(() => {
    FanWarehouse();
})
var warehouseId = route.query.warehouseId;
//反填

const FanWarehouse = () => {
    axios.get(http.zblnb + '/erpck/api/Warehouse/FillWarehouse?WarehouseId=' + warehouseId).then((res) => {
        var wtypelists = '';
        switch (res.data.data.wType) {
            case 1:
                wtypelists = '成品区'
                break;
            case 2:
                wtypelists = '待检验'
                break;
            case 3:
                wtypelists = '生产车间线边库'
                break;
            case 4:
                wtypelists = '良品区'
                break;
            case 8:
                wtypelists = '不良品仓库'
                break;
            case 6:
                wtypelists = '半成品仓库'
                break;
        }
        form.updDto.warehouseId = route.query.warehouseId
        form.wTypes = wtypelists
        form.updDto.wNumber = res.data.data.wNumber
        form.updDto.wType = res.data.data.wType
        form.updDto.wName = res.data.data.wName
        form.updDto.wAddress = res.data.data.wAddress
        form.updDto.IsDel = res.data.data.IsDel
        form.updDto.warehouseRemark = res.data.data.warehouseRemark
        form.updDto.addName = res.data.data.addName
        form.updDto.addTime = res.data.data.addTime
    })
}

//取消
const onCancel = () => {
    router.push('/ShowAllocate')
}
</script>